package com.ghy.springcloudribbon.controller;

import com.ghy.springcloudribbon.service.ConsumerService;
import com.ghy.springcloudribbon.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author ghy
 * @date 2019-03-24 22:49
 **/
@RestController
public class ConsumerController {
    @Autowired
    private ConsumerService consumerService;
    @RequestMapping(value = "/ribbon-consumer",method = RequestMethod.GET)
    public String helloController() {
        return consumerService.hello();
    }


    @Autowired
    HelloService helloService;

    @RequestMapping("/sayHello")
    public String hello() {
        return helloService.sayHello();
    }
}